
#ifndef __ASS_JSON_UTIL_H
#define __ASS_JSON_UTIL_H

#include "include/rapidjson/document.h"
#include <string>

class AssJsonUtil
{
public:
	static void AddJsonDictStringValue(rapidjson::Value& dict,rapidjson::Document::AllocatorType& allocator,
		const char* key, const char* str);

	static void AddJsonDictInt64Value(rapidjson::Value& dict,rapidjson::Document::AllocatorType& allocator,
		const char* key,int64_t bb);

	static void AddJsonDictUInt64Value(rapidjson::Value& dict,rapidjson::Document::AllocatorType& allocator,
		const char* key,uint64_t bb);

	static void AddJsonDictIntValue(rapidjson::Value& dict,rapidjson::Document::AllocatorType& allocator,
		const char* key,int bb);

	static void AddJsonDictObjectValue(rapidjson::Value& dict,rapidjson::Document::AllocatorType& allocator,
		const char* key,rapidjson::Value& value);

	static void AddJsonDictBooleanValue(rapidjson::Value& dict,rapidjson::Document::AllocatorType& allocator,
		const char* key,bool value);

	static void PushJsonArrayStringValue(rapidjson::Value& array,rapidjson::Document::AllocatorType& allocator,
		const char* str);

	static void PushJsonArrayIntValue(rapidjson::Value& array,rapidjson::Document::AllocatorType& allocator,
		int value);

	static void PushJsonArrayInt64Value(rapidjson::Value& array,rapidjson::Document::AllocatorType& allocator,
		int64_t value);

	static void PushJsonArrayObjectValue(rapidjson::Value& array,rapidjson::Document::AllocatorType& allocator,
		rapidjson::Value& one);

	static std::string ToString(rapidjson::Value& value);

	static int64_t JsonObjectToInt(rapidjson::Value& object,const char* key);
	static std::string JsonObjectToString(rapidjson::Value& object,const char* key);
};

#endif